package com.lin.missyou.sample;

/**
 * @author gcq
 * @Create 2021-10-03
 */
import com.lin.missyou.sample.condtion.DianaCondition;
import com.lin.missyou.sample.condtion.IreliaCondition;
import com.lin.missyou.sample.hero.Diana;
import com.lin.missyou.sample.hero.Irelia;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HeroConfiguration {

//    @Bean
//    @Conditional(DianaCondition.class)
//    @ConditionalOnProperty(value = "hero.condition", havingValue = "diana", matchIfMissing = true)
    public ISkill diana(){
        return new Diana();
    }

    @Bean
//    @Conditional(IreliaCondition.class)
//    @ConditionalOnProperty(value = "hero.condition", havingValue = "irelia")
    public ISkill irelia(){
        return new Irelia();
    }
}